package com.fly.system.controller;

import org.springframework.stereotype.Controller;

/**
 * @CLASSNAME: LoginController
 * @author: Fly
 * 日期: 2020/6/6  10:02
 * 描述:
 **/
@Controller
public class LoginController {
/*
    @GetMapping("/login")
    public String getLogin(){
        return "/login";
    }



    @PostMapping("/login")
    @ResponseBody
    public ResultMsg postLogin(SysUserModel user){
        UsernamePasswordToken token = new UsernamePasswordToken(user.getLoginName(),user.getPassword());
        Subject subject = SecurityUtils.getSubject();
        try{
            subject.login(token);
            return ResultMsg.success();
        }catch (IncorrectCredentialsException e){
            return ResultMsg.error("用户或名密码错误");
        }catch (AuthenticationException e){
            return ResultMsg.error("认证失败请确认用户名密码是否正确");
        }
    }

    @RequestMapping("/index")
    public String index(){
        return "/index";
    }*/
}
